package cn.geoportal.benoserver.mapper;

import cn.geoportal.benoserver.entity.ConvertTask;
import cn.geoportal.benoserver.entity.IotInfo;
import cn.geoportal.benoserver.entity.vo.converttask.ConvertTaskGet;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @Entity cn.geoportal.benoserver.entity.ConvertTask
 */
public interface ConvertTaskMapper extends BaseMapper<ConvertTask> {
    /**
     *
     * @param page
     * @param wrapper
     * @return
     */
    IPage<ConvertTask> queryConvertTaskPage(Page<ConvertTask> page, @Param(Constants.WRAPPER) QueryWrapper<ConvertTask> wrapper);

    /**
     *
     * @param name
     * @param description
     * @param typeid
     * @param source
     * @param target
     * @param epsg
     * @param center
     * @return
     */
    @Select("INSERT INTO t_convert_task(name, description, typeid, source, target, epsg, center, status) values(#{name}, #{description}, #{typeid}, #{source}, #{target}, #{epsg}, #{center}, #{status} ) RETURNING id")
    @Options(flushCache = Options.FlushCachePolicy.TRUE)
    int addConvertTask(@Param("name") String name, @Param("description") String description, @Param("typeid") Integer typeid,
               @Param("source") String source, @Param("target") String target,
               @Param("epsg") String epsg, @Param("center") String center,
               @Param("status") String status);

    /**
     *
     * @param id
     * @return
     */
    ConvertTaskGet getConvertTaskById(Integer id);
}




